From: Florian Müllner Date: Thu, 4 Jun 2020 20:14:15 +0000 (+0200) Subject: calendar-server: Notify HasCalendar changes when updating views X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~306 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=12c7f693d0b0d37a6a1df7d1001dd8ffc40437a0;p=gnome-shell.git calendar-server: Notify HasCalendar changes when updating views The HasCalendar property reflects whether there are any views, and views change either when clients appear/disappear or when the time range changes. However we currently only emit the PropertiesChanged signal for the former, fix that. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1300 --- diff --git a/src/calendar-server/gnome-shell-calendar-server.c b/src/calendar-server/gnome-shell-calendar-server.c index 100b77b36..b15b16785 100644 --- a/src/calendar-server/gnome-shell-calendar-server.c +++ b/src/calendar-server/gnome-shell-calendar-server.c @@ -721,6 +721,9 @@ static void app_update_views (App *app) { GSList *link, *clients; + gboolean had_views, has_views; + + had_views = app->live_views != NULL; for (link = app->live_views; link; link = g_slist_next (link)) { @@ -745,6 +748,11 @@ app_update_views (App *app) app->live_views = g_slist_prepend (app->live_views, view); } + has_views = app->live_views != NULL; + + if (has_views != had_views) + app_notify_has_calendars (app); + g_slist_free_full (clients, g_object_unref); }